package com.sylvek.sentinel;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author sylvek
 * 
 */
public class Emergency implements Parcelable {

    public String name;
    
    public double latitude;

    public double longitude;

    public String postAddress;

    public long time;

    public String text;

    public String getLatLon()
    {
        return this.latitude + "," + this.longitude;
    }

    @Override
    public int describeContents()
    {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags)
    {
        dest.writeString(name);
        dest.writeString(text);
        dest.writeString(postAddress);
        dest.writeLong(time);
        dest.writeDouble(latitude);
        dest.writeDouble(longitude);
    }

    public static final Parcelable.Creator<Emergency> CREATOR = new Parcelable.Creator<Emergency>() {
        public Emergency createFromParcel(Parcel in)
        {
            return new Emergency(in);
        }

        public Emergency[] newArray(int size)
        {
            return new Emergency[size];
        }
    };

    private Emergency(Parcel in)
    {
        name = in.readString();
        text = in.readString();
        postAddress = in.readString();
        time = in.readLong();
        latitude = in.readDouble();
        longitude = in.readDouble();
    }
}
